<template>
    <div>
        <el-table
                v-loading="$store.state.isLoading"
                :border="true"
                :data="$store.state.personner.personnerLog"
                style="width: 100%">
            <el-table-column label="ID" width="250">
                <template slot-scope="scope">
                    {{scope.row._id}}
                </template>
            </el-table-column>
            <el-table-column
                    label="日期"
                    width="200">
                <template slot-scope="scope">
                    <i class="el-icon-time"></i>
                    <span style="margin-left: 10px">{{ scope.row.loginTime | date }}</span>
                </template>
            </el-table-column>
            <el-table-column label="姓名">
                <template slot-scope="scope">
                    {{scope.row.adminName}}
                </template>
            </el-table-column>
            <el-table-column label="操作">
                <template slot-scope="scope">

                    <el-button size="mini" type="danger" @click="deleteOne(scope.row._id)" >删除</el-button>
                </template>
            </el-table-column>
        </el-table>
        <PageInfo actions-name="getPersonnerLog"></PageInfo>
        <!--<div class="toolbar">-->
            <!--<el-pagination-->
                    <!--background-->
                    <!--layout="prev, pager, next"-->
                    <!--:page-count="pageSum"-->
                    <!--:current-page="pageIndex"-->
                    <!--@current-change="getAdminLog"-->
            <!--&gt;-->
            <!--</el-pagination>-->
        <!--</div>-->

    </div>
</template>

<script>
    import axios from "axios";

    export default {
        name: "personner-log",

        data(){
            return {
                // pageSum:1,
                // pageIndex:1,
                // adminLog:[]
            }
        },
        mounted(){
            // console.log(this.$store.state.admin.status,111)
        },
        methods:{
            async deleteOne(id){
                const path = this.$route.path
                const data = await this.$store.dispatch("deleteOneById",{id,path})
                 if(data.ok ===1)
                    this.$store.dispatch("getPersonnerLog")
            }
           
        }
    }
</script>

<style scoped>

</style>